package com.phoenix.es.repository;

import com.phoenix.es.pojo.Product;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

public interface ProductRepository extends ElasticsearchRepository<Product,String> {
    //1. 自动派生查询,根据方法名自动生成查询
    List<Product> findByName(String name);
    List<Product> findByPriceBetween(Double lower, Double higher);

    //2.使用@Query注解自定义DSL查询
    List<Product> searchByNameCustom(String name);
}
